package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DivineCaseMapper;
import com.ruoyi.system.domain.DivineCase;
import com.ruoyi.system.service.IDivineCaseService;

/**
 * 卡牌问答的案例Service业务层处理
 * 
 * @author DEREK
 * @date 2023-10-12
 */
@Service
public class DivineCaseServiceImpl extends ServiceImpl<DivineCaseMapper, DivineCase> implements IDivineCaseService 
{
    @Autowired
    private DivineCaseMapper divineCaseMapper;

    /**
     * 查询卡牌问答的案例
     * 
     * @param id 卡牌问答的案例主键
     * @return 卡牌问答的案例
     */
    @Override
    public DivineCase selectDivineCaseById(Long id)
    {
        return divineCaseMapper.selectDivineCaseById(id);
    }

    /**
     * 查询卡牌问答的案例列表
     * 
     * @param divineCase 卡牌问答的案例
     * @return 卡牌问答的案例
     */
    @Override
    public List<DivineCase> selectDivineCaseList(DivineCase divineCase)
    {
        return divineCaseMapper.selectDivineCaseList(divineCase);
    }

    /**
     * 新增卡牌问答的案例
     * 
     * @param divineCase 卡牌问答的案例
     * @return 结果
     */
    @Override
    public int insertDivineCase(DivineCase divineCase)
    {
        divineCase.setCreateTime(DateUtils.getNowDate());
        return divineCaseMapper.insertDivineCase(divineCase);
    }

    /**
     * 修改卡牌问答的案例
     * 
     * @param divineCase 卡牌问答的案例
     * @return 结果
     */
    @Override
    public int updateDivineCase(DivineCase divineCase)
    {
        return divineCaseMapper.updateDivineCase(divineCase);
    }

    /**
     * 批量删除卡牌问答的案例
     * 
     * @param ids 需要删除的卡牌问答的案例主键
     * @return 结果
     */
    @Override
    public int deleteDivineCaseByIds(Long[] ids)
    {
        return divineCaseMapper.deleteDivineCaseByIds(ids);
    }

    /**
     * 删除卡牌问答的案例信息
     * 
     * @param id 卡牌问答的案例主键
     * @return 结果
     */
    @Override
    public int deleteDivineCaseById(Long id)
    {
        return divineCaseMapper.deleteDivineCaseById(id);
    }
}
